import 'package:dirver/widgets/common_image.dart';
import 'package:flutter/material.dart';
import 'recommend.dart';

const TextStyle _titleStyle = TextStyle(fontSize: 14,color: Colors.black,fontWeight: FontWeight.w400 );

class RecommendItem extends StatelessWidget {
  final Recommend data;
  const RecommendItem({Key? key,required this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => Navigator.of(context).pushNamed(data.navigateUrl),
      child: Container(
        padding: EdgeInsets.all(10),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Column(
              children: [
                Text(data.title,style: _titleStyle,),
                Text(data.subtitle,style: _titleStyle.copyWith(color: Colors.black45),),
              ],  
            ),
            CommonImage(src: data.imgUrl,width: 60,height: 60,fit: BoxFit.cover,),
          ],
        ),
      ),
    );
  }
}
